package com.ruoyi.order.xxJob;


import com.ruoyi.order.mapper.TbOrderMapper;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

@Service
public class ReconciliationXXjbo {

    @Autowired
    TbOrderMapper tbOrderMapper;
    /**
     * 数据预热 xxl job
     */
    @XxlJob("ReconciliationTime")
    public void  Reconciliation(){
        SimpleDateFormat sdf = new SimpleDateFormat();
        Date date = new Date();
        String endTime = sdf.format(date);

        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.add(Calendar.DATE, -3);
        Date createTime = calendar.getTime();

        String money=tbOrderMapper.selectTbOrderTime(endTime,createTime);
        System.out.println(money);
    }
}
